package com.thunder.component;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;

import com.thunder.utils.Constant;
import com.thunder.utils.GameUtil;

public class Top {
	private final BufferedImage restart;
	private final BufferedImage pause;
	
	public Top() {
		restart = GameUtil.loadBufferedImage(Constant.RESTART_IMG_PATH);
		pause = GameUtil.loadBufferedImage(Constant.PAUSE_IMG_PATH);
	}
	
	public void draw(Graphics g, int score) {
		g.setColor(Color.red);
		g.fillRect(0, 0, 600, 80);
		g.drawImage(pause, 10, 30, null); //(10,30)-(60,90)
		g.drawImage(restart, 480, 40, null); //(480,30)-(600,90)
		g.setColor(Color.white);
		g.setFont(new Font("楷体",Font.ITALIC, 40));
		g.drawString("得分:" + String.valueOf(score), 230, 65);
	}
}
